<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveRecord::ConnectionAdapters::MysqlAdapter</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveRecord::ConnectionAdapters::MysqlAdapter</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter_rb.html">
                vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="AbstractAdapter.html">
                AbstractAdapter
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
The MySQL adapter will work with both Ruby/MySQL, which is a Ruby-based
MySQL adapter that comes bundled with Active Record, and with the faster
C-based MySQL/Ruby adapter (available both as a gem and from <a
href="http://www.tmtm.org/en/mysql/ruby">www.tmtm.org/en/mysql/ruby</a>/).
</p>
<p>
Options:
</p>
<ul>
<li><tt>:host</tt> &#8212; Defaults to localhost

</li>
<li><tt>:port</tt> &#8212; Defaults to 3306

</li>
<li><tt>:socket</tt> &#8212; Defaults to /tmp/mysql.sock

</li>
<li><tt>:username</tt> &#8212; Defaults to root

</li>
<li><tt>:password</tt> &#8212; Defaults to nothing

</li>
<li><tt>:database</tt> &#8212; The name of the database. No default, must be
provided.

</li>
<li><tt>:encoding</tt> &#8212; (Optional) Sets the client encoding by executing
&quot;SET NAMES &lt;encoding&gt;&quot; after connection

</li>
<li><tt>:sslkey</tt> &#8212; Necessary to use MySQL with an SSL connection

</li>
<li><tt>:sslcert</tt> &#8212; Necessary to use MySQL with an SSL connection

</li>
<li><tt>:sslcapath</tt> &#8212; Necessary to use MySQL with an SSL connection

</li>
<li><tt>:sslcipher</tt> &#8212; Necessary to use MySQL with an SSL connection

</li>
</ul>
<p>
By default, the <a href="MysqlAdapter.html">MysqlAdapter</a> will consider
all columns of type tinyint(1) as boolean. If you wish to disable this
emulation (which was the default behavior in versions 0.13.1 and earlier)
you can add the following line to your environment.rb file:
</p>
<pre>
  ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans = false
</pre>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001231">active?</a>&nbsp;&nbsp;
      <a href="#M001237">charset</a>&nbsp;&nbsp;
      <a href="#M001238">collation</a>&nbsp;&nbsp;
      <a href="#M001235">create_database</a>&nbsp;&nbsp;
      <a href="#M001236">current_database</a>&nbsp;&nbsp;
      <a href="#M001233">disconnect!</a>&nbsp;&nbsp;
      <a href="#M001239">drop_table</a>&nbsp;&nbsp;
      <a href="#M001227">new</a>&nbsp;&nbsp;
      <a href="#M001228">quote</a>&nbsp;&nbsp;
      <a href="#M001230">quoted_false</a>&nbsp;&nbsp;
      <a href="#M001229">quoted_true</a>&nbsp;&nbsp;
      <a href="#M001232">reconnect!</a>&nbsp;&nbsp;
      <a href="#M001240">rename_table</a>&nbsp;&nbsp;
      <a href="#M001234">select_rows</a>&nbsp;&nbsp;
      <a href="#M001241">show_variable</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">LOST_CONNECTION_ERROR_MESSAGES</td>
          <td>=</td>
          <td class="context-item-value">[         &quot;Server shutdown in progress&quot;,         &quot;Broken pipe&quot;,         &quot;Lost connection to MySQL server during query&quot;,         &quot;MySQL server has gone away&quot;</td>
        </tr>
        </table>
      </div>
    </div>



      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M001227" class="method-detail">
        <a name="M001227"></a>

        <div class="method-heading">
          <a href="#M001227" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(connection, logger, connection_options, config)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001227-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001227-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 163</span>
163:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">logger</span>, <span class="ruby-identifier">connection_options</span>, <span class="ruby-identifier">config</span>)
164:         <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">logger</span>)
165:         <span class="ruby-ivar">@connection_options</span>, <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">connection_options</span>, <span class="ruby-identifier">config</span>
166: 
167:         <span class="ruby-identifier">connect</span>
168:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001231" class="method-detail">
        <a name="M001231"></a>

        <div class="method-heading">
          <a href="#M001231" class="method-signature">
          <span class="method-name">active?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
CONNECTION MANAGEMENT ====================================
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001231-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001231-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 244</span>
244:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">active?</span>
245:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:stat</span>)
246:           <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">stat</span>
247:         <span class="ruby-keyword kw">else</span>
248:           <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">query</span> <span class="ruby-value str">'select 1'</span>
249:         <span class="ruby-keyword kw">end</span>
250: 
251:         <span class="ruby-comment cmt"># mysql-ruby doesn't raise an exception when stat fails.</span>
252:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:errno</span>)
253:           <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">errno</span>.<span class="ruby-identifier">zero?</span>
254:         <span class="ruby-keyword kw">else</span>
255:           <span class="ruby-keyword kw">true</span>
256:         <span class="ruby-keyword kw">end</span>
257:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Mysql</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
258:         <span class="ruby-keyword kw">false</span>
259:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001237" class="method-detail">
        <a name="M001237"></a>

        <div class="method-heading">
          <a href="#M001237" class="method-signature">
          <span class="method-name">charset</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the database character set.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001237-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001237-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 376</span>
376:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">charset</span>
377:         <span class="ruby-identifier">show_variable</span> <span class="ruby-value str">'character_set_database'</span>
378:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001238" class="method-detail">
        <a name="M001238"></a>

        <div class="method-heading">
          <a href="#M001238" class="method-signature">
          <span class="method-name">collation</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the database <a href="MysqlAdapter.html#M001238">collation</a>
strategy.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001238-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001238-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 381</span>
381:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collation</span>
382:         <span class="ruby-identifier">show_variable</span> <span class="ruby-value str">'collation_database'</span>
383:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001235" class="method-detail">
        <a name="M001235"></a>

        <div class="method-heading">
          <a href="#M001235" class="method-signature">
          <span class="method-name">create_database</span><span class="method-args">(name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Create a <a href="MysqlAdapter.html#M001227">new</a> MySQL database with
optional :<a href="MysqlAdapter.html#M001237">charset</a> and :<a
href="MysqlAdapter.html#M001238">collation</a>. Charset defaults to utf8.
</p>
<p>
Example:
</p>
<pre>
  create_database 'charset_test', :charset =&gt; 'latin1', :collation =&gt; 'latin1_bin'
  create_database 'matt_development'
  create_database 'matt_development', :charset =&gt; :big5
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001235-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001235-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 359</span>
359:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_database</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
360:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:collation</span>]
361:           <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;CREATE DATABASE `#{name}` DEFAULT CHARACTER SET `#{options[:charset] || 'utf8'}` COLLATE `#{options[:collation]}`&quot;</span>
362:         <span class="ruby-keyword kw">else</span>
363:           <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;CREATE DATABASE `#{name}` DEFAULT CHARACTER SET `#{options[:charset] || 'utf8'}`&quot;</span>
364:         <span class="ruby-keyword kw">end</span>
365:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001236" class="method-detail">
        <a name="M001236"></a>

        <div class="method-heading">
          <a href="#M001236" class="method-signature">
          <span class="method-name">current_database</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001236-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001236-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 371</span>
371:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_database</span>
372:         <span class="ruby-identifier">select_value</span> <span class="ruby-value str">'SELECT DATABASE() as db'</span>
373:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001233" class="method-detail">
        <a name="M001233"></a>

        <div class="method-heading">
          <a href="#M001233" class="method-signature">
          <span class="method-name">disconnect!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001233-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001233-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 266</span>
266:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect!</span>
267:         <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
268:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001239" class="method-detail">
        <a name="M001239"></a>

        <div class="method-heading">
          <a href="#M001239" class="method-signature">
          <span class="method-name">drop_table</span><span class="method-args">(table_name, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001239-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001239-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 391</span>
391:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_table</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">options</span> = {})
392:         <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">options</span>)
393:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001228" class="method-detail">
        <a name="M001228"></a>

        <div class="method-heading">
          <a href="#M001228" class="method-signature">
          <span class="method-name">quote</span><span class="method-args">(value, column = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
QUOTING ==================================================
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001228-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001228-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 198</span>
198:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quote</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">column</span> = <span class="ruby-keyword kw">nil</span>)
199:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">column</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">column</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:binary</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">column</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:string_to_binary</span>)
200:           <span class="ruby-identifier">s</span> = <span class="ruby-identifier">column</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">string_to_binary</span>(<span class="ruby-identifier">value</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;H*&quot;</span>)[<span class="ruby-value">0</span>]
201:           <span class="ruby-node">&quot;x'#{s}'&quot;</span>
202:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">BigDecimal</span>)
203:           <span class="ruby-node">&quot;'#{value.to_s(&quot;F&quot;)}'&quot;</span>
204:         <span class="ruby-keyword kw">else</span>
205:           <span class="ruby-keyword kw">super</span>
206:         <span class="ruby-keyword kw">end</span>
207:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001230" class="method-detail">
        <a name="M001230"></a>

        <div class="method-heading">
          <a href="#M001230" class="method-signature">
          <span class="method-name">quoted_false</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001230-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001230-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 225</span>
225:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quoted_false</span>
226:         <span class="ruby-value str">&quot;0&quot;</span>
227:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001229" class="method-detail">
        <a name="M001229"></a>

        <div class="method-heading">
          <a href="#M001229" class="method-signature">
          <span class="method-name">quoted_true</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001229-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001229-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 221</span>
221:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quoted_true</span>
222:         <span class="ruby-value str">&quot;1&quot;</span>
223:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001232" class="method-detail">
        <a name="M001232"></a>

        <div class="method-heading">
          <a href="#M001232" class="method-signature">
          <span class="method-name">reconnect!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001232-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001232-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 261</span>
261:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reconnect!</span>
262:         <span class="ruby-identifier">disconnect!</span>
263:         <span class="ruby-identifier">connect</span>
264:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001240" class="method-detail">
        <a name="M001240"></a>

        <div class="method-heading">
          <a href="#M001240" class="method-signature">
          <span class="method-name">rename_table</span><span class="method-args">(table_name, new_name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001240-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001240-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 421</span>
421:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rename_table</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">new_name</span>)
422:         <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;RENAME TABLE #{quote_table_name(table_name)} TO #{quote_table_name(new_name)}&quot;</span>
423:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001234" class="method-detail">
        <a name="M001234"></a>

        <div class="method-heading">
          <a href="#M001234" class="method-signature">
          <span class="method-name">select_rows</span><span class="method-args">(sql, name = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
DATABASE STATEMENTS ======================================
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001234-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001234-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 273</span>
273:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select_rows</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>)
274:         <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">query_with_result</span> = <span class="ruby-keyword kw">true</span>
275:         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span>)
276:         <span class="ruby-identifier">rows</span> = []
277:         <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span> <span class="ruby-identifier">rows</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">row</span> }
278:         <span class="ruby-identifier">result</span>.<span class="ruby-identifier">free</span>
279:         <span class="ruby-identifier">rows</span>
280:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001241" class="method-detail">
        <a name="M001241"></a>

        <div class="method-heading">
          <a href="#M001241" class="method-signature">
          <span class="method-name">show_variable</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
SHOW VARIABLES LIKE &#8216;name&#8216;
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001241-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001241-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 452</span>
452:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_variable</span>(<span class="ruby-identifier">name</span>)
453:         <span class="ruby-identifier">variables</span> = <span class="ruby-identifier">select_all</span>(<span class="ruby-node">&quot;SHOW VARIABLES LIKE '#{name}'&quot;</span>)
454:         <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value str">'Value'</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">empty?</span>
455:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>